import request from '@/utils/request'

const URL =  "http://localhost:8080"

export function login(username, password) { //登录接口
    return request({ //使用封装好的 axios 进行网络请求
        url: '/admin/login',
        method: 'post',
        data: { //提交的数据
            username,
            password
        }
    })
}
export function userRegister(data) {
    return request({
        url: URL +'/user',
        method: 'post',
        data

    })
}


export function userLogin(data) {
    return request({
        url: URL +'/user/login',
        method: 'post',
        data
    })
}

export function getUserInfo(token) {
    return request({
        url: URL +'/user/token',
        method: 'get',
        params: {
            token: token
        }
    })
}
export function logout() {
    return request({
        url: URL +'/user/logout',
        method: 'post',
        params: {

        }
    })
}
